<?php
/*
 *   This file is part of poat.
 *
 *   poat is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   poat is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with poat.  If not, see <http://www.gnu.org/licenses/>.
 */
 
global $STATUS_LIST;
global $FILE_STATUS_LIST;
global $GROUP_LIST;
//global $AVAILABLE_LANGUAGES_LIST;

include_once(ROOT_PATH."configs/ver.php");

$STATUS_LIST = array();
$FILE_STATUS_LIST = array();
$GROUP_LIST = array();

$defs = simplexml_load_file(ROOT_PATH."configs/definitions.xml");
foreach($defs->definition as $def) {
   eval("define('{$def->name}', '{$def->value}');");
   if (substr_count($def->name,'FILE_STATUS_')>0) {
   		array_push($FILE_STATUS_LIST,$def->value);
   } elseif (substr_count($def->name,'STATUS_')>0) {
   		array_push($STATUS_LIST,$def->value);
   } elseif (substr_count($def->name,'GROUP_')>0) {
   		array_push($GROUP_LIST,$def->value);
   }
}

$defs = simplexml_load_file(ROOT_PATH."configs/tables.xml");
foreach($defs->table as $def) {
   eval("define('{$def->name}', '{$def->value}');");
}

$TIMEZONE_LIST = array();

$defs = simplexml_load_file(ROOT_PATH."configs/timezones.xml");
foreach($defs->timezone as $def) {
	$tzone = array("value" => $def->value,"name" => $def->name);
	array_push($TIMEZONE_LIST,$tzone);
}
/*
$AVAILABLE_LANGUAGES_LIST = array();
$defs = simplexml_load_file('configs/available_languages.xml');
foreach($defs->lang as $def) {
	array_push($AVAILABLE_LANGUAGES_LIST,$def);
}
*/
?>